package net.lanelife.casino.cms.web.controller;

import java.util.List;

import javax.servlet.ServletRequest;

import net.lanelife.casino.caipiao.dto.admin.RechargeRecordDTO;
import net.lanelife.casino.caipiao.dto.admin.RechargeRecordTable;
import net.lanelife.casino.caipiao.entity.RechargeRecord;
import net.lanelife.casino.caipiao.service.api.IRechargeRecordService;
import net.lanelife.casino.cms.web.controller.support.CRUDController;
import net.lanelife.casino.cms.web.controller.support.UserSearchFilter;
import net.lanelife.casino.common.dto.support.GenericDTO;
import net.lanelife.casino.common.repository.SearchFilter;
import net.lanelife.casino.common.service.support.IGenericService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = RechargeRecordController.PATH)
public class RechargeRecordController extends CRUDController<RechargeRecord, Integer, RechargeRecordDTO, GenericDTO<Integer>, GenericDTO<Integer>, RechargeRecordTable<RechargeRecordDTO>> {
	
	public static final String PATH = "/recharge-record";
	
	public RechargeRecordController() {
		super(PATH);
	}

	@Autowired
	private IRechargeRecordService rechargeRecordService;
	
	@Autowired
	private UserSearchFilter userSearchFilter;
	
	@Override
	protected IGenericService<RechargeRecord, Integer> getService() {
		return rechargeRecordService;
	}
	
	@Override
	protected void postList(Model model, Pageable pageable, ServletRequest request, List<SearchFilter> filters) throws Exception {
		userSearchFilter.buildSearchFilter(filters, request);
	}

}
